/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.ufrn.cerescaico.sepe.dao;

import br.ufrn.cerescaico.sepe.beans.Bean;
import br.ufrn.cerescaico.sepe.dao.util.DataAccessLayerException;
import java.util.List;

/**
 *
 * @author Taciano
 */
public interface Dao<T extends Bean> {
    
    /**
     * Insert a new Event into the database.
     *
     * @param event
     */
    void create(T bean) throws DataAccessLayerException;

    /**
     * Updates the state of a detached Event.
     *
     * @param bean
     */
    void update(T bean) throws DataAccessLayerException;

    /**
     * Delete a detached Event from the database.
     *
     * @param event
     */
    void delete(T bean) throws DataAccessLayerException;

    /**
     * Delete a detached Event from the database.
     *
     * @param id
     */
    void delete(Integer id) throws DataAccessLayerException;

    /**
     * Find an object by its primary key.
     *
     * @param id
     * @return
     */
    T find(Integer id) throws DataAccessLayerException;

    /**
     * Finds all Events in the database.
     *
     * @return
     */
    List<T> findAll() throws DataAccessLayerException;
}
